home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Netware Super Library
/
Netware Super Library.iso
/
mis_cnvt
/
hex_dec
/
aehex.prg
Wrap
Text File
|
1990-04-25
|
780b
|
31 lines
* CLIPPER UDF - HEX to Decimal
* Brought to you by Auto Exec BBS - (508) 833-0508 - 1.2 Gigabyte
* Specializing in CLIPPER/dbase/Foxbase/'C'
* 6 Nodes
* Only Registration required to download 450k/Day.
*
**************************************************************************
Clear
hexn=space(4)
@1,10 say "Enter Hex Number: " get hexn picture "@!"
read
Dec=DecEquiv(Hexn)
@3,10 say "Decimal Equivalent is: "+str(dec)
return
FUNCTION DECEQUIV
Parameters Hexn
private Ans, AllHex, N1, N2, N3, N4
AllHex="123456789ABCDEF"
N1=AT(SUBSTR(HexN,1,1),AllHex)
N2=AT(SUBSTR(HexN,2,1),AllHex)
N3=AT(SUBSTR(HexN,3,1),AllHex)
N4=AT(SUBSTR(HexN,4,1),AllHex)
Ans=(N1*4096)+(N2*256)+(N3*16)+N4
Return(Ans)
***** Eof DecEquiv